<?php

namespace App\Http\Controllers\Admin;

use App\Models\Renting;
use Illuminate\Http\Request;

class RentingController extends BaseController
{
    //列表
    public function index()
    {
        //获取所有租客信息
        $data=Renting::orderBy('id','desc')->paginate($this->pagesize);
        return view('admin.renting.index',compact('data'));
    }
    //查看租客收藏房源信息
    public function fav(Renting $renting){
        //利用多对多关系来进行房源信息列表数据展示
        $data=$renting->fangs()->paginate($this->pagesize);
        return view('admin.renting.fav',compact('data'));
    }
}
